# 菜品
class Food:
    id = ""
    # 用户属性
    food_name = ""          # 姓名
    desc = ""
    img_url = ""
    type = ""
    create_time = ""
    diningHall = ""
    ingredient = ""
    remind = ""

    # 构造方法，初始化用户对象
    def __init__(self, food_name):
        self.food_name = food_name

    # 静态方法，从字典解码用户信息
    @staticmethod
    def decode(food_dict):
        food = Food(food_dict['food_name'])
        food.desc = food_dict['desc']
        food.img_url = food_dict['img_url']
        food.type = food_dict['type']
        food.diningHall = food_dict['dingHall']
        food.ingredient = food_dict['ingredient']
        food.remind = food_dict['remind']
        return food






